package com.rickpan.dto.response;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.time.LocalDateTime;

/**
 * 搜索建议响应DTO
 *
 * @author RickPan Team
 * @since 2025-07-03
 */
public class SearchSuggestionResponse {

    private String id;
    private String type; // file, folder, recent
    private String name;
    private String path;
    private String icon;
    private String size;
    private String parentFolder;
    private String folderId;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime modifiedAt;

    /**
     * 默认构造方法
     */
    public SearchSuggestionResponse() {
    }

    /**
     * 文件建议构造方法
     */
    public SearchSuggestionResponse(String id, String type, String name, String path, 
                                  String icon, String size, String parentFolder, 
                                  String folderId, LocalDateTime modifiedAt) {
        this.id = id;
        this.type = type;
        this.name = name;
        this.path = path;
        this.icon = icon;
        this.size = size;
        this.parentFolder = parentFolder;
        this.folderId = folderId;
        this.modifiedAt = modifiedAt;
    }

    /**
     * 文件夹建议构造方法
     */
    public SearchSuggestionResponse(String id, String type, String name, String path, 
                                  String parentFolder, String folderId) {
        this.id = id;
        this.type = type;
        this.name = name;
        this.path = path;
        this.icon = "folder";
        this.parentFolder = parentFolder;
        this.folderId = folderId;
    }

    // Getters and Setters
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public String getSize() {
        return size;
    }

    public void setSize(String size) {
        this.size = size;
    }

    public String getParentFolder() {
        return parentFolder;
    }

    public void setParentFolder(String parentFolder) {
        this.parentFolder = parentFolder;
    }

    public String getFolderId() {
        return folderId;
    }

    public void setFolderId(String folderId) {
        this.folderId = folderId;
    }

    public LocalDateTime getModifiedAt() {
        return modifiedAt;
    }

    public void setModifiedAt(LocalDateTime modifiedAt) {
        this.modifiedAt = modifiedAt;
    }

    @Override
    public String toString() {
        return "SearchSuggestionResponse{" +
                "id='" + id + '\'' +
                ", type='" + type + '\'' +
                ", name='" + name + '\'' +
                ", path='" + path + '\'' +
                ", icon='" + icon + '\'' +
                ", size='" + size + '\'' +
                ", parentFolder='" + parentFolder + '\'' +
                ", folderId='" + folderId + '\'' +
                ", modifiedAt=" + modifiedAt +
                '}';
    }
}
